package com.danciyixue.boot.client.semester.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.danciyixue.boot.common.result.PageResult;
import com.danciyixue.boot.common.result.Result;
import com.danciyixue.boot.dcyx.model.entity.Semester;
import com.danciyixue.boot.dcyx.model.query.SemesterQuery;
import com.danciyixue.boot.dcyx.model.vo.SemesterVO;
import com.danciyixue.boot.dcyx.service.SemesterService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 客户端学期控制器
 */
@Tag(name = "02. 学期", description = "学期")
@RestController
@RequestMapping("/api/client/v1/semester")
@RequiredArgsConstructor
public class DcyxSemesterController {

    private final SemesterService dcyxSemesterService;

    /**
     * 获取学期数据
     *
     */
    @GetMapping("/page")
    public PageResult<SemesterVO> page(SemesterQuery queryParams) {
        IPage<SemesterVO> page = dcyxSemesterService.getSemesterPage(queryParams);
        return PageResult.success(page);
    }
}